Skip to content

[AIT-1081] Update liveobjects uts-to-kotlin skill to generate tests#1221

Merged
sacOO7 merged 11 commits into
feature/path-based-liveobjects-implementationfrom
feature/liveobjects-uts-tests
Jun 30, 2026
Merged

[AIT-1081] Update liveobjects uts-to-kotlin skill to generate tests#1221
sacOO7 merged 11 commits into
feature/path-based-liveobjects-implementationfrom
feature/liveobjects-uts-tests

Conversation

@sacOO7

@sacOO7 sacOO7 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator
  • Fixes https://ably.atlassian.net/browse/AIT-1081
  • Generated UTS markdown to have better understanding of existing UTS infra.
  • This is also helpful for a relevant uts-to-kotlin skill to better generate ably-java tests
  • Based on the doc, we have missing sandbox test, need to update the same

📚 Human-readable UTS guide + website

To make the UTS setup approachable, this PR adds a comprehensive guide and a self-contained website, kept in sync:

  • uts/README.md — renders on the module's GitHub page.
  • uts/index.html — a standalone, offline-friendly website (inline SVG flow diagrams, scroll-spy nav, light/dark theme; no external assets).

Both walk through: what UTS is → the three test tiers → the spec docs (linked to GitHub) → the uts/ module layout → the SDK hook points → the unit & proxy infrastructure → the two example tests → deviations → how to run → appendices (flow diagrams + per-file API reference + source map).

🗂️ Test package restructure

Test sources are reorganised under a domain-rooted io.ably.lib.uts package that cleanly separates infrastructure from tests, and unit from integration:

io/ably/lib/uts/
├── infra/                        # test infrastructure (no @Test methods)
│   ├── Utils.kt                  #   shared awaits (awaitState / pollUntil …)
│   ├── unit/                     #   mock transports + ConnectionDetails builder
│   └── integration/              #   SandboxApp
│       └── proxy/                #     ProxyManager, ProxySession
├── unit/realtime/                # UNIT tests          → ConnectionRecoveryTest
└── integration/proxy/realtime/   # INTEGRATION tests   → AuthReauthTest

The unit/infra/unit/ and integration/infra/integration/ pairing is what the new Gradle tasks key off.

Note: the ConnectionDetails test builder no longer lives in io.ably.lib.types, so it now obtains the package-private constructor reflectively (same approach as liveobjects/.../TestUtils.kt).

⚙️ Per-tier Gradle tasks + CI wiring

Added two package-filtered test tasks in uts/build.gradle.kts, mirroring runLiveObjectsUnitTests / runLiveObjectsIntegrationTests:

Task Runs CI
:uts:runUtsUnitTests io.ably.lib.uts.unit.* (mocked, fast) check.yml (PR gate)
:uts:runUtsIntegrationTests io.ably.lib.uts.integration.* (real sandbox + proxy) integration-test.yml → new check-uts job

✅ Validation

  • ./gradlew :uts:runUtsUnitTests → 6/6 pass · :uts:runUtsIntegrationTests → 1/1 pass.
  • Full CI gate checkWithCodenarc checkstyleMain checkstyleTest runUnitTests runLiveObjectsUnitTests :uts:runUtsUnitTestsBUILD SUCCESSFUL.

Summary by CodeRabbit

  • New Features
    • Added comprehensive UTS documentation and an in-repo guide for unit, direct-sandbox integration, and proxy tests.
    • Introduced dedicated Gradle tasks for running UTS unit vs integration suites.
    • Added new integration coverage for channel history and token request flows.
  • Bug Fixes
    • Improved reconnect test synchronization for more reliable retry verification.
    • Updated tier-specific test execution to use the correct Gradle tasks and filters.
  • Documentation
    • Expanded UTS reference materials, deviation guidance, and translation conventions (including proxy/evaluate-mode notes).
  • CI
    • Added a CI check job for UTS integration tests.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@sacOO7, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e55b975e-772b-4772-a660-8f8ec18facd8

📥 Commits

Reviewing files that changed from the base of the PR and between 6f2c56d and d11eb61.

📒 Files selected for processing (2)
  • .claude/skills/uts-to-kotlin/SKILL.md
  • .claude/skills/uts-to-kotlin/scripts/audit_translation.py

Walkthrough

The UTS test module now uses separate unit and integration Gradle tasks and CI jobs, reorganized infra packages, new direct-sandbox and LiveObjects tests, and updated UTS skill docs, resolver, mapping, and reference guides.

Changes

UTS infrastructure, tests, and translation docs

Layer / File(s) Summary
Build and CI entry points
uts/build.gradle.kts, .github/workflows/check.yml, .github/workflows/integration-test.yml
Adds runUtsUnitTests and runUtsIntegrationTests, adds :liveobjects runtime and JUnit params dependencies, updates the check workflow to use the unit task, and adds a check-uts integration job.
Infra package split and host wiring
uts/src/test/kotlin/io/ably/lib/uts/infra/Utils.kt, uts/src/test/kotlin/io/ably/lib/uts/infra/unit/*, uts/src/test/kotlin/io/ably/lib/uts/infra/integration/SandboxApp.kt, uts/src/test/kotlin/io/ably/lib/uts/infra/integration/proxy/ProxyManager.kt, uts/src/test/kotlin/io/ably/lib/uts/infra/integration/proxy/ProxySession.kt
Moves unit infra into io.ably.lib.uts.infra.unit, moves integration helpers into the new integration namespaces, centralizes sandbox host handling in SandboxApp, removes proxy host constants, updates ProxySession.create defaults, and adds query parsing plus a reflective ConnectionDetails builder DSL.
Existing test updates
uts/src/test/kotlin/io/ably/lib/uts/unit/realtime/ConnectionRecoveryTest.kt, uts/src/test/kotlin/io/ably/lib/uts/integration/proxy/realtime/AuthReauthTest.kt
Switches the tests to the new infra packages and changes ConnectionRecoveryTest to wait for the second reconnect attempt before asserting query parameters.
New direct-sandbox integration tests
uts/src/test/kotlin/io/ably/lib/uts/integration/standard/realtime/ChannelHistoryTest.kt, uts/src/test/kotlin/io/ably/lib/uts/integration/standard/realtime/TokenRequestTest.kt
Adds a parameterized cross-client history test with ordering checks and a sandbox-backed token request auth test with client-id assertions.
LiveObjects unit helpers
uts/src/test/kotlin/io/ably/lib/uts/unit/liveobjects/Helpers.kt
Adds JSON builders, object-state/protocol-message helpers, reflective ObjectMessage construction, a fixed object fixture, and synced-channel setup helpers using MockWebSocket.
Skill workflow, references, and guides
.claude/skills/uts-to-kotlin/SKILL.md, .claude/skills/uts-to-kotlin/uts-package-mapping.json, .claude/skills/uts-to-kotlin/scripts/resolve_uts.py, .claude/skills/uts-to-kotlin/references/objects-mapping.md, uts/README.md, uts/index.html
Reworks the UTS-to-Kotlin skill around module-directory resolution and tier-specific evaluation, adds the resolver script and mapping JSON, expands the LiveObjects translation reference, and replaces the UTS guide with README and interactive HTML documentation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • ably/ably-java#1209: Introduces the UTS-to-Kotlin groundwork that this PR extends with module-directory resolution and tiered test execution.
  • ably/ably-java#1210: Refactors the proxy integration helpers that this PR moves into the new uts package layout and rewires to SandboxApp.
  • ably/ably-java#1216: Adds LiveObjects API surface that the new Helpers.kt and objects translation reference build around.

Suggested reviewers

  • ttypic
  • lawrence-forooghian

Poem

🐇 Hop hop, the UTS paths are bright,
Unit and integration split just right.
The resolver hums, the docs now sing,
LiveObjects helpers give tests their spring.
This bunny nods at the tidy run,
And twitches ears for all the work well done.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: the UTS-to-Kotlin skill was updated to generate Kotlin tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/liveobjects-uts-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 09:10 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 09:12 Inactive
Move the human-readable UTS guide and its self-contained HTML rendering
into the uts/ module as README.md and index.html. Both cover the UTS
concept, the three test tiers, the spec docs, the uts/ module layout,
mock/proxy infrastructure, the two example tests, deviations, and
appendices. Spec-doc references link to GitHub; paths are fully
qualified; the two artifacts are kept in sync.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 09:54 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 09:55 Inactive
@sacOO7 sacOO7 changed the title Generated UTS doc to better understand the existing UTS infra. [AIT-1008] Generate LiveObjects tests based on UTS test specs Jun 25, 2026
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 11:08 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 11:09 Inactive
…ier Gradle tasks

Reorganise the uts module under a domain-rooted io.ably.lib.uts package that
cleanly separates infrastructure from tests, and unit from integration:

  infra/                         shared awaits (Utils.kt)
  infra/unit/                    mock transports + ConnectionDetails builder
  infra/integration/             SandboxApp
  infra/integration/proxy/       ProxyManager, ProxySession
  unit/realtime/                 ConnectionRecoveryTest        (mocked)
  integration/proxy/realtime/    AuthReauthTest                (sandbox + proxy)

- The ConnectionDetails test builder no longer sits in io.ably.lib.types, so it
  obtains the package-private constructor reflectively (as liveobjects/TestUtils.kt does).
- Add runUtsUnitTests / runUtsIntegrationTests Gradle tasks (filtered by package),
  mirroring runLiveObjectsUnitTests / runLiveObjectsIntegrationTests.
- check.yml now runs :uts:runUtsUnitTests; integration-test.yml gains a check-uts
  job running :uts:runUtsIntegrationTests.
- Bring uts/README.md and uts/index.html in sync with the new structure.
@sacOO7 sacOO7 force-pushed the feature/liveobjects-uts-tests branch from 884ee87 to aa0504e Compare June 25, 2026 11:25
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 11:26 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 11:27 Inactive
Reflect the new test-source structure in the UTS guide, website, and the
uts-to-kotlin skill:

- Add the direct-sandbox (`integration/standard/<module>/`) tier alongside
  the existing unit and proxy tiers, and document that every tier is now
  organised by module (`realtime`, `liveobjects`, …).
- Update §2 tier table, §4.2 directory tree + mental model, §7.3 SandboxApp
  (shared by both integration kinds), and §12 run commands in README.md, and
  mirror all of it in index.html (tags verified balanced, sections intact).
- Generalise the skill's spec→test path mapping to `<module>`, add a
  direct-sandbox row, and split integration specs into fault-injecting (proxy)
  vs happy-path (direct sandbox) flows.
- Correct stale "both tiers" wording now that there are three tiers.
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 11:44 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 11:46 Inactive
…ckage mapping

Rework the uts-to-kotlin skill to translate a whole UTS module at once
instead of a single spec file:

- Take a UTS module directory (e.g. .../specification/uts/objects) and
  validate it sits directly under uts/ with a standard tier structure.
- Resolve the target ably-java package via uts-package-mapping.json (a new
  config file alongside the skill): a shared `testRoot` parent plus a
  `packages` table mapping each source module to its per-tier output dir
  (so objects -> liveobjects is explicit). Offer to create a mapping when
  one is missing.
- Let the user pick a tier (unit / integration / proxy) and then translate
  all specs or a selected subset, looping each through the existing
  per-spec translation steps.

Phase 1 (selection: Steps A-D) is new; Phase 2 (per-spec translation:
Steps 1-7) keeps the existing rules, with Step 1/2 adjusted to consume the
looped spec and the pre-resolved target.
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 12:27 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 12:29 Inactive
…aluate mode

Make the skill's selection phase deterministic and add an explicit
translate-vs-evaluate choice:

- Add scripts/resolve_uts.py — a bundled resolver that validates the module
  directory, reads uts-package-mapping.json, and emits JSON with, per tier,
  the target dir, Kotlin package, and the candidate specs with derived class
  names. This replaces the per-run hand-work (regex validation, path joins,
  snake_case->PascalCase) that the model previously improvised, so Phase 1 is
  byte-for-byte deterministic. Exclusions are checked relative to the tier
  base (robust to the checkout location), and --create guards the target name.
- Rewrite Phase 1 (Steps A-E) around the resolver: resolve, confirm/create
  mapping, choose tier, choose specs, choose translate-only vs evaluate.
- Gate Step 6 (run/fix) behind evaluate mode per writing-derived-tests.md's
  Translation (always) vs Evaluation (only when an implementation exists)
  split; translate-only stops after compile + review.
- Make the reference fetch mandatory (WebFetch added to allowed-tools).
- Fix the file template to use the resolver's package/className (no hardcoded
  realtime, no double Test suffix) and the spec's full @uts id; correct stale
  uts/test/... proxy doc paths.
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 16:58 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 16:59 Inactive
…rence

The objects UTS specs are written in ably-js-style pseudocode, but ably-java
is a typed SDK (RTTS1-10 partition). Add references/objects-mapping.md mapping
each ably-js symbol to its ably-java equivalent: entry point, async
(CompletableFuture/await), the typed PathObject/Instance hierarchies and as*
casts, the LiveMapValue write union, creation value types, subscriptions,
sync-state events, ValueType, message/operation getters, error codes, path
dot-escaping, and the internal-graph caveat for unit specs.

Wire it in deterministically: each module declares its translation reference
via a `notes` field in uts-package-mapping.json; resolve_uts.py resolves it to
`translationNotes` (absolute path, or null), and SKILL.md makes it required
reading before Phase 2 when present.
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 18:50 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 18:52 Inactive
…ap them

Translate objects/helpers/standard_test_pool.md into ably-java test helpers in
uts/.../unit/liveobjects/helpers.kt: the standard object pool, the protocol- and
object-message builders (emitting the integer-coded wire JSON the SDK's Gson
expects), setupSyncedChannel/NoAck over the existing MockWebSocket, and
buildPublicObjectMessage — which reaches the internal PAOM3/PAOOP3 construction
(WireObjectMessage -> DefaultObjectMessage) by reflection, so it runs today even
though the rest of :liveobjects is unimplemented. Add testRuntimeOnly(:liveobjects)
so that reflection resolves while keeping the compile classpath decoupled.

Wire the mapping reference at it: objects-mapping.md gains a "Unit-test helpers"
section mapping each spec helper to its Kotlin name, and §11/§13 are corrected to
note public_object_message.md is translatable via buildPublicObjectMessage rather
than internal-only.
@sacOO7 sacOO7 force-pushed the feature/liveobjects-uts-tests branch from 8276473 to 752b45e Compare June 25, 2026 19:45
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 19:46 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 19:48 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 20:56 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 20:58 Inactive
@sacOO7 sacOO7 force-pushed the feature/liveobjects-uts-tests branch from e38b889 to 752b45e Compare June 25, 2026 20:59
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 25, 2026 21:00 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 25, 2026 21:01 Inactive
…efactor

- Add ChannelHistoryTest (RTL10d) and TokenRequestTest (RSA9/RSA9a/RSA9g)
  direct-sandbox integration tests, parameterised over json/msgpack.
- Add junit-jupiter-params dependency (@ParameterizedTest / @valuesource).
- Consolidate the sandbox host into a single SandboxApp.sandboxHost constant
  (removed from ProxyManager; ProxySession defaults both hosts to it).
- Sync uts/README.md, uts/index.html, and the uts-to-kotlin SKILL.md for the
  direct-sandbox tier: new ChannelHistoryTest walkthrough, integration-tests
  umbrella section, section renumber.
- Rename unit liveobjects helpers.kt -> Helpers.kt (case-only).
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 29, 2026 18:12 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 29, 2026 18:13 Inactive
@sacOO7 sacOO7 changed the title [AIT-1008] Generate LiveObjects tests based on UTS test specs [AIT-1081] Update liveobjects uts-to-kotlin skill to generate tests Jun 29, 2026
@sacOO7 sacOO7 marked this pull request as ready for review June 29, 2026 18:53
@sacOO7 sacOO7 changed the title [AIT-1081] Update liveobjects uts-to-kotlin skill to generate tests [AIT-1081] Update liveobjects uts-to-kotlin skill to generate tests Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
.claude/skills/uts-to-kotlin/SKILL.md (1)

353-374: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make this template tier-specific and use explicit imports.

This scaffold is presented as the resolver-selected tier template, but it still hardcodes unit-only setup (infra.unit.*, MockWebSocket, ConnectionDetails) and star imports. That makes the integration/proxy path easy to start from the wrong skeleton even though later sections require SandboxApp / ProxySession wiring. Split this into per-tier templates (or relabel this one as unit-only) and list concrete imports instead of *.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/uts-to-kotlin/SKILL.md around lines 353 - 374, This template
is still unit-only even though it is presented as the resolver-selected tier
scaffold, and it also relies on star imports. Update the Skill.md template
around the test scaffold to either split it into separate tier-specific
templates or clearly label this one as unit-only, and replace the wildcard
imports with explicit imports for the exact symbols used. Make sure the correct
tier-specific setup is shown for the resolver path, especially the symbols that
differ between unit and integration/proxy flows such as SandboxApp and
ProxySession.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/uts-to-kotlin/references/objects-mapping.md:
- Around line 530-545: The helper reference in the objects-mapping docs uses the
wrong filename casing, so update the guidance to point consistently to
Helpers.kt instead of helpers.kt. Fix the prose and the table entry that
references uts/src/test/kotlin/io/ably/lib/uts/unit/liveobjects/Helpers.kt so
readers can locate the actual helper file and related symbols like
setupSyncedChannel, setupSyncedChannelNoAck, buildObjectSyncMessage, and
buildPublicObjectMessage without path mismatches.
- Around line 137-147: Add language tags to the fenced code examples in the
objects-mapping reference so markdownlint stops flagging them and syntax
highlighting is restored. Update the affected examples in the translation
guidance sections around the root.entries()/root.keys() snippets and the other
noted example blocks to use an appropriate tag such as kotlin, markdown, or
text, keeping the existing content unchanged.

In `@uts/build.gradle.kts`:
- Around line 44-54: The custom Test tasks runUtsUnitTests and
runUtsIntegrationTests only set filters, so they are not actually wired to the
UTS test source set. Update these tasks in uts/build.gradle.kts to inherit the
same testClassesDirs and classpath as the built-in test task, and keep the
existing includeTestsMatching filters so they execute the intended
io.ably.lib.uts.unit and io.ably.lib.uts.integration tests instead of passing
empty.

In `@uts/README.md`:
- Around line 42-59: The README contains unlabeled fenced code blocks that
trigger markdownlint and lose syntax highlighting. Update the fenced blocks in
the affected diagram/example sections to include an appropriate language
identifier such as text or kotlin, using the same README content around the
spec/test hierarchy and other referenced fenced blocks, so the markdown stays
lint-clean and renders correctly.

---

Nitpick comments:
In @.claude/skills/uts-to-kotlin/SKILL.md:
- Around line 353-374: This template is still unit-only even though it is
presented as the resolver-selected tier scaffold, and it also relies on star
imports. Update the Skill.md template around the test scaffold to either split
it into separate tier-specific templates or clearly label this one as unit-only,
and replace the wildcard imports with explicit imports for the exact symbols
used. Make sure the correct tier-specific setup is shown for the resolver path,
especially the symbols that differ between unit and integration/proxy flows such
as SandboxApp and ProxySession.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27e70f9e-9e77-46d5-a860-34d544c796f2

📥 Commits

Reviewing files that changed from the base of the PR and between b56407f and 0c59d15.

📒 Files selected for processing (32)
  • .claude/skills/uts-to-kotlin/SKILL.md
  • .claude/skills/uts-to-kotlin/references/objects-mapping.md
  • .claude/skills/uts-to-kotlin/scripts/resolve_uts.py
  • .claude/skills/uts-to-kotlin/uts-package-mapping.json
  • .github/workflows/check.yml
  • .github/workflows/integration-test.yml
  • uts/README.md
  • uts/build.gradle.kts
  • uts/index.html
  • uts/src/test/kotlin/io/ably/lib/types/Utils.kt
  • uts/src/test/kotlin/io/ably/lib/uts/deviations.md
  • uts/src/test/kotlin/io/ably/lib/uts/infra/Utils.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/integration/SandboxApp.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/integration/proxy/ProxyManager.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/integration/proxy/ProxySession.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/ClientFactories.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/DefaultPendingConnection.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/DefaultPendingRequest.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/FakeClock.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockEvent.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockHttpClient.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockHttpEngine.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockWebSocket.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockWebSocketEngineFactory.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/PendingConnection.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/PendingRequest.kt
  • uts/src/test/kotlin/io/ably/lib/uts/infra/unit/Utils.kt
  • uts/src/test/kotlin/io/ably/lib/uts/integration/proxy/realtime/AuthReauthTest.kt
  • uts/src/test/kotlin/io/ably/lib/uts/integration/standard/realtime/ChannelHistoryTest.kt
  • uts/src/test/kotlin/io/ably/lib/uts/integration/standard/realtime/TokenRequestTest.kt
  • uts/src/test/kotlin/io/ably/lib/uts/unit/liveobjects/Helpers.kt
  • uts/src/test/kotlin/io/ably/lib/uts/unit/realtime/ConnectionRecoveryTest.kt
💤 Files with no reviewable changes (1)
  • uts/src/test/kotlin/io/ably/lib/types/Utils.kt

Comment thread .claude/skills/uts-to-kotlin/references/objects-mapping.md Outdated
Comment thread .claude/skills/uts-to-kotlin/references/objects-mapping.md Outdated
Comment thread uts/build.gradle.kts
Comment thread uts/README.md Outdated

@ttypic ttypic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the uts/ module’s usability and automation by adding a comprehensive UTS guide + standalone HTML site, restructuring UTS test packages under io.ably.lib.uts, and wiring per-tier Gradle/CI test tasks. It also expands integration test coverage (direct sandbox) and updates the uts-to-kotlin skill to support module-wide translation with deterministic path/package resolution.

Changes:

  • Added human-readable UTS documentation (uts/README.md) plus an offline-friendly mirrored website (uts/index.html).
  • Reorganized UTS test + infra packages (io.ably.lib.uts.*), introduced per-tier Gradle tasks, and updated CI to run unit vs integration tiers separately.
  • Added/updated UTS-derived tests and LiveObjects UTS helper infrastructure to support generated test suites.

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
uts/src/test/kotlin/io/ably/lib/uts/unit/realtime/ConnectionRecoveryTest.kt Moves test into io.ably.lib.uts.unit.* namespace and adds a reconnect gating step to reduce transient-state flake.
uts/src/test/kotlin/io/ably/lib/uts/unit/liveobjects/Helpers.kt Adds LiveObjects wire-message builders and synced-channel setup helpers (incl. reflective construction of internal liveobjects message types).
uts/src/test/kotlin/io/ably/lib/uts/integration/standard/realtime/TokenRequestTest.kt Adds direct-sandbox integration coverage for token request creation being accepted by the service.
uts/src/test/kotlin/io/ably/lib/uts/integration/standard/realtime/ChannelHistoryTest.kt Adds direct-sandbox integration coverage for cross-client history durability, parameterized over protocol format.
uts/src/test/kotlin/io/ably/lib/uts/integration/proxy/realtime/AuthReauthTest.kt Repackages proxy integration test to new io.ably.lib.uts.integration.* layout and updates infra imports.
uts/src/test/kotlin/io/ably/lib/uts/infra/Utils.kt Moves shared async helpers into io.ably.lib.uts.infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/Utils.kt Introduces reflective ConnectionDetails { ... } builder DSL in unit infra (replacing prior package-local constructor access).
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/PendingRequest.kt Repackages unit infra pending-request abstraction under io.ably.lib.uts.infra.unit.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/PendingConnection.kt Repackages unit infra pending-connection abstraction under io.ably.lib.uts.infra.unit.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockWebSocketEngineFactory.kt Repackages mock WebSocket engine factory under io.ably.lib.uts.infra.unit.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockWebSocket.kt Repackages mock WebSocket infra and aligns imports with new unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockHttpEngine.kt Repackages mock HTTP engine infra and updates references after package move.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockHttpClient.kt Repackages mock HTTP client infra under unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/MockEvent.kt Repackages transport event logging types under unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/FakeClock.kt Repackages fake clock under unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/DefaultPendingRequest.kt Repackages default pending-request implementation under unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/DefaultPendingConnection.kt Repackages default pending-connection implementation under unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/unit/ClientFactories.kt Repackages test client factories under unit infra.
uts/src/test/kotlin/io/ably/lib/uts/infra/integration/SandboxApp.kt Moves sandbox provisioning helper into io.ably.lib.uts.infra.integration and centralizes sandboxHost.
uts/src/test/kotlin/io/ably/lib/uts/infra/integration/proxy/ProxySession.kt Updates proxy session to new infra packages and defaults upstream host via SandboxApp.sandboxHost.
uts/src/test/kotlin/io/ably/lib/uts/infra/integration/proxy/ProxyManager.kt Repackages proxy manager and removes redundant sandbox host constants now owned by SandboxApp.
uts/src/test/kotlin/io/ably/lib/uts/deviations.md Adds/records documented SDK-vs-spec deviations discovered during UTS translation.
uts/src/test/kotlin/io/ably/lib/types/Utils.kt Removes legacy ConnectionDetails builder previously placed in io.ably.lib.types.
uts/README.md Adds comprehensive UTS guide covering tiers, infra, layout, and how to run tests.
uts/index.html Adds standalone offline documentation site mirroring uts/README.md.
uts/build.gradle.kts Adds JUnit params dep, runtime-only liveobjects dep for reflective tests, and tier-filtered test tasks.
.github/workflows/integration-test.yml Adds check-uts job to run :uts:runUtsIntegrationTests in CI.
.github/workflows/check.yml Updates PR gate to run :uts:runUtsUnitTests instead of all UTS tests.
.claude/skills/uts-to-kotlin/uts-package-mapping.json Adds explicit mapping from UTS modules to uts/ target packages/dirs for the translation skill.
.claude/skills/uts-to-kotlin/SKILL.md Expands the uts-to-kotlin skill to module-wide translation with tier selection and deterministic resolution.
.claude/skills/uts-to-kotlin/scripts/resolve_uts.py Adds deterministic resolver script for module→tier→package/class-name mapping used by the skill.
.claude/skills/uts-to-kotlin/references/objects-mapping.md Adds a detailed objects→liveobjects (ably-js→ably-java) translation map for the skill and contributors.
Comments suppressed due to low confidence (1)

uts/src/test/kotlin/io/ably/lib/uts/unit/realtime/ConnectionRecoveryTest.kt:249

  • capturedQueryParams is mutated from MockWebSocket.onConnectionAttempt (runs synchronously on the SDK thread) and read from pollUntil (uses Dispatchers.Default). Using a plain mutableListOf() here can introduce a data race/flaky test behavior under concurrency. Prefer a thread-safe collection (e.g. CopyOnWriteArrayList) or synchronize both the writer and the pollUntil predicate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread uts/README.md Outdated
Comment thread uts/index.html Outdated
Comment thread .claude/skills/uts-to-kotlin/scripts/resolve_uts.py Outdated
- objects-mapping.md: correct helper filename casing helpers.kt -> Helpers.kt
  (broken source-nav on case-sensitive filesystems); tag bare code fences as
  `text` to clear markdownlint MD040.
- README.md: tag bare fences as `text`; correct the msgpack rationale — ably-java
  does implement msgpack (useBinaryProtocol = true by default), the real reason
  proxy tests force JSON is that the proxy only handles text WebSocket frames.
- index.html: mirror the README msgpack correction.
- SKILL.md: label the unit-tier test scaffold as such and point integration/proxy
  flows at the SandboxApp/ProxySession section.
- resolve_uts.py: validate the module path via Path.parts instead of a
  forward-slash-only regex, so Windows paths are accepted.
- ConnectionRecoveryTest: use CopyOnWriteArrayList for the query-param capture
  list (written on the SDK transport thread, read on the coroutine dispatcher)
  to remove a visibility race / flake risk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/features June 30, 2026 10:00 Inactive
@github-actions github-actions Bot temporarily deployed to staging/pull/1221/javadoc June 30, 2026 10:02 Inactive
Translation review (SKILL.md Step 7) relied on eyeballing the spec and the
generated Kotlin side-by-side to confirm every test case, setup step, operation
and assertion was carried over — exactly the mechanical comparison the model
does inconsistently. Add a bundled extractor so the review reconciles a concrete
ledger instead.

scripts/audit_translation.py (regex-only, no semantic judgement, deterministic):
- idCoverage: spec `**Test ID**` set vs Kotlin `@UTS` tags -> missing / orphan.
- perTest[].sections: every non-comment pseudo-block line, grouped by section
  and tagged assert / await / step, so setup + operations + assertions are all
  enumerated; assertionShortfall flags likely-dropped assertions.
- Robustness: never crashes — tolerant decoding plus a top-level guard always
  emit one JSON object. Exit 0 clean / 2 missing-or-orphan / 64 couldn't-run,
  via a fail() helper matching resolve_uts.py's error shape.

SKILL.md Step 7 now runs the audit first and reconciles its output line by line
(coverage + completeness), keeping setup-fidelity and deviation-honesty as the
semantic checks; paths reference the resolver's specs[].file / targetDir.
@sacOO7 sacOO7 merged commit 0834c45 into feature/path-based-liveobjects-implementation Jun 30, 2026
12 of 14 checks passed
@sacOO7 sacOO7 deleted the feature/liveobjects-uts-tests branch June 30, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants